<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <?php
    session_start();
    $user = $_SESSION['user'];

    $file = $_GET['filename'];

    $dir = dirname(__FILE__) . "\\file\\$user\\";

    if (unlink($dir . $file)) {
        echo '<script>alert("删除成功!");window.location.href = "index.php";</script>';
    } else {
        echo '<script>alert("删除失败,请检查权限!");window.location.href = "index.php";</script>';
    }


    ?>
</body>

</html>